package com.azier.kapacitor.script.node.nodebind;

import com.azier.kapacitor.script.node.HttpOutNode;
import com.azier.kapacitor.script.node.Node;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create an HTTP output node that caches the most recent data it has received. The cached data is available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at /kapacitor/v1/tasks/<task_id> and endpoint is top10, then the data can be requested from /kapacitor/v1/tasks/<task_id>/top10.
**/

/**
创建一个HTTP输出节点，该节点缓存已接收到的最新数据。缓存的数据在给定的端点可用。端点是从正在运行的任务的API端点开始的相对路径。例如，如果任务终结点位于/ kapacitor / v1 / tasks / <task_id>，并且终结点为top10，则可以从/ kapacitor / v1 / tasks / <task_id> / top10请求数据。
**/
public interface HttpOutNodeBind extends Node {
    /**
    Create an HTTP output node that caches the most recent data it has received. The cached data is available at the given endpoint. The endpoint is the relative path from the API endpoint of the running task. For example, if the task endpoint is at /kapacitor/v1/tasks/<task_id> and endpoint is top10, then the data can be requested from /kapacitor/v1/tasks/<task_id>/top10.
    **/
    /**
    创建一个HTTP输出节点，该节点缓存已接收到的最新数据。缓存的数据在给定的端点可用。端点是从正在运行的任务的API端点开始的相对路径。例如，如果任务终结点位于/ kapacitor / v1 / tasks / <task_id>，并且终结点为top10，则可以从/ kapacitor / v1 / tasks / <task_id> / top10请求数据。
    **/
    default HttpOutNode httpOut(String endpoint){
        HttpOutNode nextNode = new HttpOutNode(endpoint);
        this.setNextNode(nextNode);
        nextNode.zetHeadNode(this.getHeadNode());
        return nextNode;
    }
}